<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>图片上传</title>
    <link rel="stylesheet" href="./css/index.css">
</head>
<body>
    <!-- 容器 -->
    <div class="box">
        <!-- accept：接受的类型 -->
        <input type="file" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" onchange="imgPreview(this)">
    </div>
    <button type="button" onclick="uploadImage()">点击上传图片</button>

    <script src="./js/index.js"></script>
</body>
</html>